<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use App\Jobs\test\TestJob;

class Kernel extends ConsoleKernel
{
    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        // 每分钟执行一次定时任务
        //   /www/wwwroot/yijia.api.likai.vip/likai_yijia
        //$schedule->job(new TestJob, 'test_redis_list', 'redis')->everyFiveMinutes();
        //$schedule->command('queue:work redis --queue=testredislist')->everyMinute()->runInBackground();
        $schedule->command('command:testredislist')->everyMinute()->withoutOverlapping();
        $schedule->command('queue:work redis --queue=batchAddJobTypePrice')->everyMinute()->withoutOverlapping();
    }

    /**
     * Register the commands for the application.
     *
     * @return void
     */
    protected function commands()
    {
        $this->load(__DIR__.'/Commands');

        require base_path('routes/console.php');
    }
}
